import java.util.Scanner;

public class Answer1 {
    // 游游的you
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);

        int n=in.nextInt();
        int a,b,c;

        while(n-- !=0){
            a= in.nextInt();
            b= in.nextInt();
            c= in.nextInt();
            int x=Math.min(a,Math.min(b,c));
            System.out.println(x*2+Math.max(b-x-1,0));
        }

    }
}
